package jspservlet.servlet;

import java.io.IOException;
import java.util.ArrayList;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import javax.servlet.ServletContext;

import jspservlet.dao.UserDAO;
import jspservlet.dao.impl.UserDAOImpl;
import jspservlet.vo.User;

public class ShowDeviceInfoServelt extends HttpServlet{
	
	public void doGet(HttpServletRequest req, HttpServletResponse res)
			throws IOException, ServletException{
	}
	public void doPost(HttpServletRequest req, HttpServletResponse res)
		    throws IOException, ServletException{
		
		UserDAO dao=new UserDAOImpl();
		ServletContext application = this.getServletContext();
		HttpSession session=req.getSession();
		session.setAttribute("username", (String) application.getAttribute("username"));
		User user=new User();
		user.setUsername(application.getAttribute("username").toString());
		try {
			int flag = dao.showDeviceInfo(user);
		}catch(Exception e) {
			e.printStackTrace();
		}
		
	}
}
